<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/*
 * Created on 2012-7-5
 * 后台登陆
 *
 */
class Home extends MY_ADMIN_Controller{
	
	var $beforeFilter = array();
	
	public function __construct() {
		parent::__construct();
		$this->lang->load('sysconfig');
		$this->lang->load('template');
		$this->load->database();
	}
	
	function index() {	
		$info = array();
		
		$info['os']            	= PHP_OS;		
    	$info['ip']            	= $_SERVER['SERVER_ADDR'];
    	$info['web_server']    	= $_SERVER['SERVER_SOFTWARE'];
    	$info['php_ver']       	= PHP_VERSION;
    	$info['db_ver']		  	= $this->db->platform().''.$this->db->version();
    	$info['zlib']      		= function_exists('gzclose') ? $this->lang->line('tpl_yes'): $this->lang->line('tpl_no');
    	$info['safe_mode']		= ini_get('safe_mode') ?   $this->lang->line('tpl_yes'):$this->lang->line('tpl_no');
    	$info['safe_mode_gid'] = ini_get('safe_mode_gid') ?  $this->lang->line('tpl_yes'):$this->lang->line('tpl_no');
    	$info['timezone']      = function_exists("date_default_timezone_get") ? date_default_timezone_get() : $this->lang->line('no_timezone');
    	$info['socket']        = function_exists('fsockopen') ? $this->lang->line('tpl_yes'):$this->lang->line('tpl_no');
		$info['file_maxsize'] = ini_get("file_uploads") ? ini_get("upload_max_filesize") : "Disabled";
		
		$gd = getGdVersion();
		if ($gd == 0)
    	{
        	$info['gd'] = 'N/A';
    	}
    	else
    	{
        if ($gd == 1)
        {
            $info['gd'] = 'GD1';
        }
        else
        {
            $info['gd'] = 'GD2';
        }

        $info['gd'] .= ' (';

        /* 检查系统支持的图片类型 */
        if ($gd && (imagetypes() & IMG_JPG) > 0)
        {
            $info['gd'] .= ' JPEG';
        }

        if ($gd && (imagetypes() & IMG_GIF) > 0)
        {
            $info['gd'] .= ' GIF';
        }

        if ($gd && (imagetypes() & IMG_PNG) > 0)
        {
            $info['gd'] .= ' PNG';
        }

        $info['gd'] .= ')';
    	}
    	$this->assign['sysinfo'] = $info;
		$this->display();
	}
	function top(){
		$this->load->view('admin/home/top');
	}
	function main(){
		$this->load->view('admin/home/main');
	}
	function bottom(){
		$this->load->view('admin/home/bottom');
	}
}

/* End of file admin.php */
/* Location: ./application/controllers/admin.php */